/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * StatisticMedicine.java
 *
 * Created on Apr 28, 2012, 6:57:38 AM
 */

package MedicineManage;

import BillManage.Bills;
import CustomerManage.Customer;
import java.sql.SQLException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author manh
 */
public class StatisticMedicine extends javax.swing.JPanel {
     int cout;
    private DefaultTableModel modelTableMedicine1  = new DefaultTableModel();
     private DefaultComboBoxModel cmdMedininename = new DefaultComboBoxModel();
private DefaultComboBoxModel cmdMedininename1 = new DefaultComboBoxModel();
    private DefaultComboBoxModel cmdBillType = new DefaultComboBoxModel();
    private DefaultComboBoxModel cmdCustomnername = new DefaultComboBoxModel();
    Vector vloadme=new Vector();
    Bills bills=new Bills();
    Medicines medicines=new Medicines();
    Customer customer=new Customer();
    /** Creates new form StatisticMedicine */
    public StatisticMedicine() {
        initComponents();
        try {
            vloadme = Medicines.getStaticMedicines();
        } catch (SQLException ex) {
            Logger.getLogger(StatisticMedicine.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            this.loadTableMedicine("medicine", vloadme);
        } catch (SQLException ex) {
            Logger.getLogger(StatisticMedicine.class.getName()).log(Level.SEVERE, null, ex);
        }
        ////////////////////////////////////////////////
            cmdMedininename .removeAllElements();
            cmdMedininename .addElement("--- Medinice Name--");
                Vector Name=new Vector();
        try {
           Name = medicines.getAllMedicine();
        } catch (SQLException ex) {
            Logger.getLogger(StatisticMedicine.class.getName()).log(Level.SEVERE, null, ex);
        }
            for(int j=0;j<Name.size();j++) {
               medicines=(Medicines)Name.get(j);
                cmdMedininename.addElement(medicines.getMedicineName());
            }
            box1.setModel(cmdMedininename );
            ///////////////////////////////////
                 cmdMedininename1 .removeAllElements();
            cmdMedininename1 .addElement("--- Medinice Name--");
                Vector Name1=new Vector();
        try {
           Name1= medicines.getAllMedicine();
        } catch (SQLException ex) {
            Logger.getLogger(StatisticMedicine.class.getName()).log(Level.SEVERE, null, ex);
        }
            for(int j=0;j<Name.size();j++) {
               medicines=(Medicines)Name1.get(j);
                cmdMedininename1.addElement(medicines.getMedicineName());
            }
            box4.setModel(cmdMedininename1);
//////////////////////////////////////////////////////////////////
                cmdCustomnername.removeAllElements();
                cmdCustomnername .addElement("--- Customer Name--");
                    Vector Custosmner=new Vector();
            try {
                  Custosmner= customer.getAllCustomer();
                } catch (SQLException ex) {
                     Logger.getLogger(StatisticMedicine.class.getName()).log(Level.SEVERE, null, ex);
                 }
                    for(int j=0;j<Custosmner.size();j++) {
                      customer=(Customer)Custosmner.get(j);
                     cmdCustomnername.addElement(customer.getcustomerName());
                     }
                    box2.setModel(   cmdCustomnername );
  /////////////////////////////////////////////////////////////////
            cmdBillType.removeAllElements();
            cmdBillType.addElement("---Bill Type---");
            cmdBillType.addElement("Purchase");
            cmdBillType.addElement("Sale");
            box3.setModel(cmdBillType);
    }
     public void SearchStatisic() throws SQLException
    { Vector vList = new Vector();
      if(box1.getSelectedIndex()!=0 && box3.getSelectedIndex()!=0)
      {
         vList.addElement(box1.getSelectedItem().toString());
        
          vList.addElement(box3.getSelectedItem().toString());
          vloadme=Medicines.SearchStaticMedicines(vList);
         this.loadTableMedicine("Medicine", vloadme);

        }
      else  if(box1.getSelectedIndex()==0 && box3.getSelectedIndex()!=0)
      {


          vList.addElement(box3.getSelectedItem().toString());
          vloadme=Medicines.SearchsatisticBillType(vList);
         this.loadTableMedicine("Medicine", vloadme);
      }
 else if(box1.getSelectedIndex()!=0 && box3.getSelectedIndex()==0)
      {


          vList.addElement(box1.getSelectedItem().toString());
          vloadme=Medicines.SearchsatisticMedicineName(vList);
         this.loadTableMedicine("Medicine", vloadme);
      }
 else if(box1.getSelectedIndex()==0 && box3.getSelectedIndex()==0)
      {


       //   vList.addElement(box1.getSelectedItem().toString());
          vloadme=Medicines.getStaticMedicines();
         this.loadTableMedicine("Medicine", vloadme);
      }



    }
     //////////////////////////////////////////////////////
       public void SearchStatisic1() throws SQLException
    { Vector vList = new Vector();
      if(box4.getSelectedIndex()!=0 && box2.getSelectedIndex()!=0)
      {
         vList.addElement(box4.getSelectedItem().toString());
        
          vList.addElement(box2.getSelectedItem().toString());
          vloadme=medicines.SearchsatisticMedicineCustomer(vList);
         this.loadTableMedicine("Medicine", vloadme);

        }
      else  if(box4.getSelectedIndex()==0 && box2.getSelectedIndex()!=0)
      {


          vList.addElement(box2.getSelectedItem().toString());
          vloadme=medicines.SearchsatisticCustomer(vList);
         this.loadTableMedicine("Medicine", vloadme);
      }
 else if(box4.getSelectedIndex()!=0 && box2.getSelectedIndex()==0)
      {


          vList.addElement(box4.getSelectedItem().toString());
          vloadme=medicines.SearchsatisticMedicineName(vList);
         this.loadTableMedicine("Medicine", vloadme);
      }
      else if(box2.getSelectedIndex()==0 && box4.getSelectedIndex()==0)
      {


       //   vList.addElement(box1.getSelectedItem().toString());
          vloadme=Medicines.getStaticMedicines();
         this.loadTableMedicine("Medicine", vloadme);
      }

    
      
    }
     ///////////////////////////////////////////////////////////////////////////
     public void loadTableMedicine(String nameTable,Vector vLoad) throws SQLException{
      //   int cout;
        modelTableMedicine1.setNumRows(0);
        Vector columnMedicine = new Vector();
        columnMedicine.addElement("BillCode");
        columnMedicine.addElement("MedicineName");
        columnMedicine.addElement("billType");
        columnMedicine.addElement("customerName");
        columnMedicine.addElement("dateStart");
        columnMedicine.addElement("expiredDate");
        columnMedicine.addElement("Quantity");
        columnMedicine.addElement("Status");
        modelTableMedicine1.setColumnIdentifiers(columnMedicine);
        Medicines objMedicine = new Medicines();
        for(int i=0; i<vLoad.size();i++)
        {
            objMedicine = (Medicines) vLoad.get(i);
          //  cout=vload.size();
            Vector rowMedicine = new Vector();
            rowMedicine.addElement(objMedicine.getBillCode());
            rowMedicine.addElement(objMedicine.getMedicineName());
            rowMedicine.addElement(objMedicine.getBillType());
            rowMedicine.addElement(objMedicine.getCustomerName());
            rowMedicine.addElement(objMedicine.getDateStart());
            rowMedicine.addElement(objMedicine.getExpiredTime());
            rowMedicine.addElement(objMedicine.getQuantity());
            rowMedicine.addElement(objMedicine.getStatus());
            modelTableMedicine1.addRow(rowMedicine);
        }
       txtTable.setModel(modelTableMedicine1);
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtTable = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        box1 = new javax.swing.JComboBox();
        box3 = new javax.swing.JComboBox();
        txtSearch = new javax.swing.JToggleButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        box2 = new javax.swing.JComboBox();
        Search2 = new javax.swing.JButton();
        box4 = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Medicine", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(25, 133, 133))); // NOI18N

        txtTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(txtTable);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(19, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 665, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search BillType", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(19, 113, 113))); // NOI18N

        txtSearch.setFont(new java.awt.Font("Tahoma", 1, 12));
        txtSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/search2.png"))); // NOI18N
        txtSearch.setText("Search");
        txtSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSearchActionPerformed(evt);
            }
        });

        jLabel1.setText("Medicine Name");

        jLabel2.setText("Bill Type");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(box3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(box1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addComponent(txtSearch)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(box1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addComponent(box3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(17, 17, 17)
                                .addComponent(jLabel2))))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(txtSearch)))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search CustomerName", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(0, 102, 102))); // NOI18N
        jPanel4.setForeground(new java.awt.Color(0, 102, 102));

        Search2.setFont(new java.awt.Font("Tahoma", 1, 12));
        Search2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/search2.png"))); // NOI18N
        Search2.setText("Search");
        Search2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Search2ActionPerformed(evt);
            }
        });

        jLabel3.setText("Medicine Name");

        jLabel4.setText("Customer Name");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(box2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(18, 18, 18)
                        .addComponent(box4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addComponent(Search2)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(box4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(box2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(Search2)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jButton1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/reset.png"))); // NOI18N
        jButton1.setText("Reset");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/reset.png"))); // NOI18N
        jButton2.setText("Reset");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton2))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addGap(17, 17, 17)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(28, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txtSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchActionPerformed
        try {
// TODO add your handling code here:
            this.SearchStatisic();
        } catch (SQLException ex) {
         //   ex.printStackTrace();
        }
        // TODO add your handling code here:
    }//GEN-LAST:event_txtSearchActionPerformed

    private void Search2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Search2ActionPerformed
        try {
// TODO add your handling code here:
            this.SearchStatisic1();
        } catch (SQLException ex) {
         //   ex.printStackTrace();
        }
        // TODO add your handling code here:
    }//GEN-LAST:event_Search2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
 box1.setSelectedIndex(0);

 box3.setSelectedIndex(0);


        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

 box2.setSelectedIndex(0);

 box4.setSelectedIndex(0);        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Search2;
    private javax.swing.JComboBox box1;
    private javax.swing.JComboBox box2;
    private javax.swing.JComboBox box3;
    private javax.swing.JComboBox box4;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToggleButton txtSearch;
    private javax.swing.JTable txtTable;
    // End of variables declaration//GEN-END:variables

}
